# -*- coding: utf-8 -*-

import xlwt

"""
workbook = xlwt.Workbook(encoding="utf-8")  # 创建 workbook 对象
worksheet = workbook.add_sheet("sheet1")  # 创建工作表
worksheet.write(0, 0, "hello world")  # 写入数据
workbook.save("/Users/adai/Desktop/stu.xls")  # 保存数据
"""

workbook = xlwt.Workbook(encoding="utf-8")  # 创建 workbook 对象
worksheet = workbook.add_sheet("sheet1")  # 创建工作表
for i in range(0, 9):
    for j in range(0, i + 1):
        worksheet.write(i, j, "%d * %d = %d" % (i + 1, j + 1, (i + 1) * (j + 1)))

workbook.save("stu.xls")  # 保存数据
